package com.adou.d5;

import java.util.Random;
import java.util.Scanner;

public class Test5 {
    public static void main(String[] args) {
        int[] moneys = {99,666,5555,9999,30000};
        start(moneys);

    }

    public static void start(int[] moneys) {
        Scanner sc = new Scanner(System.in);
        Random r = new Random();
        for (int i=0; i<5;i++){
            System.out.print("请输入任意内容进行抽奖:");
            sc.next();

            while (true) {
                int index = r.nextInt(moneys.length);
                int money = moneys[index];
                if (money != 0){
                    System.out.println("恭喜你，抽中红包" + money );
                    moneys[index] = 0;
                    break;
                }

            }
        }
        System.out.println("活动结束");
    }
}
